<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="app" uri="http://www.wanrenhui.com" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
	  <%@include file="/res/include/base-head.jsp"%>
	  <%@include file="/res/include/jquery-easyui.jsp"%>
	<script type="text/javascript" src="${pageContext.request.contextPath}/res/js/circle/cirlceUpgradeApply.js"></script>
  </head>
  <body>
	<div class="easyui-layout" data-options="fit:true">
		<div data-options="region:'north',border:false,split:false">
	    	<form id="query-form" class="search_form clearfix">
	            <dl>
					<dt>圈子名称：</dt>
					<dd>
						<input name="circleName" id="name" type="text" class="txt" maxlength="16"/>
					</dd>
				</dl>
	            <p class="search_form_btn">
	            	<input type="button" value="搜索" class="icon_serach" onclick="admin.cirlceUpgradeApply.query()" />
	            </p>
	        </form>
	  	</div>
	    <div data-options="region:'center',border:false">
		    <table id="datagrid" data-options="url:'${pageContext.request.contextPath}/circle/upgrade/apply/list',toolbar:'#toolbar'">
				<thead>
					<tr>
						<th data-options="field:'circleName',width:80,align:'center'">圈子</th>
						<th data-options="field:'fromZoneLevelName',width:120,align:'center' ">当前区域范围</th>
						<th data-options="field:'toZoneLevelName',width:120,align:'center' ">申请升级区域范围</th>
						<th data-options="field:'lastToExtCommunityNames',width:120,align:'center' ">已经扩展的社区</th>
						<th data-options="field:'toExtCommunityNames',width:120,align:'center' ">本次申请扩展社区</th>
						<th data-options="field:'toCityName',width:120,align:'center' ">扩展城市</th>
						<th data-options="field:'applyName',width:80,align:'center' ">申请人</th>
						<th data-options="field:'strNewAt',width:120,align:'center'">申请时间</th>
						<th data-options="field:'status',width:80,align:'center',formatter:formatStatus">状态</th>
						<th data-options="field:'applyContent',width:120,align:'center'">申请理由</th>
			            <th data-options="field:'id',align:'center',width:150,formatter:formatOperation">操作</th>
					</tr>
				</thead>
			</table>
	  	</div>
	</div>

	<script>
		function formatOperation(value,row,index) {
			var l_html = '';
			l_html += '<a href="javascript:;" class="table_link" onclick="admin.cirlceUpgradeApply.detail('+row.id+')">查看</a>';
			var id = row.id;
			var status=row.status;
			if(status==1){
				l_html+='<a href="javascript:void(0)" class="table_link" onclick="admin.cirlceUpgradeApply.auditPass('+id+')">通过</a>';
				l_html+='<a href="javascript:void(0)" class="table_link" onclick="admin.cirlceUpgradeApply.auditNoPass('+id+')">不通过</a>';
			}
			return l_html;
		}
		function formatStatus(value,row,index){
			var status=row.status;//1-待审核;2-审核通过;3-审核不通过
			if(status==1){
				return "待审核";
			}else if(status==2){
				return "已通过";
			}else if(status==3){
				return "审核不通过";
			}
		}
	</script>
  </body>
</html>
